Skip to content

feat: package manager — agentskills provider, forge adopt, forge find#79

Merged
N4M3Z merged 1 commit into
mainfrom
p4-pkg
Jul 9, 2026
Merged

feat: package manager — agentskills provider, forge adopt, forge find#79
N4M3Z merged 1 commit into
mainfrom
p4-pkg

Conversation

@N4M3Z

@N4M3Z N4M3Z commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Approach

Steal browse.sh's package-manager ergonomics; forge already has the better artifact format.

  • agentskills provider (target: .agents, aliases: [agents]) deploys skills to the agentskills.io standard .agents/skills/<Name>/SKILL.md — one output consumed by Zed and anything speaking the standard. Keyed agentskills (not agents) to avoid the qualifier-dir collision.
  • forge adopt <url> mechanizes the by-hand AdoptArtifact flow: fetch (ureq for hosted HTTPS, dotforge for git blobs), pin (content SHA-256 always, commit SHA when git), apply the align transform, land in a module, and write the adopt/v1 provenance sidecar. Path-traversal guarded (reuses the P3 containment pattern).
  • forge find <query> --json scores skills/agents/rules across local modules and watched sources; deterministic order; reserves a source field for future remote catalogs.

Adds ureq (sync, rustls, fits the no-async-core rule) as the crate's first general HTTP client. ADRs CLI-0016/0017.

Test plan

  • fmt / clippy -D warnings / test (adopt/v1 sidecar, github-blob classification, path-traversal rejection, agentskills whitelist, qualifier-collision guard)
  • smokes: forge find secret --json scores cross-module; agentskills assemble → .agents/skills/Demo/SKILL.md with the keep-list applied
  • CI matrix

🤖 Generated with Claude Code

agentskills provider (target .agents, aliases [agents]) deploys skills to the
agentskills.io standard .agents/skills/<Name>/SKILL.md. forge adopt <url>
mechanizes the AdoptArtifact skill: fetch (ureq for hosted HTTPS, dotforge for
git), pin (content SHA-256 always, commit SHA for git), align transform, land
in a module, write the adopt/v1 provenance sidecar; path-traversal guarded.
forge find <query> --json scores skills/agents/rules across local modules and
watched sources. ADRs CLI-0016/0017.
@N4M3Z

N4M3Z commented Jul 9, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review pass (agy / Gemini 3.1 Pro on the diff) found five real issues in the adopt fetch-and-write path, all fixed in the latest push:

  1. Symlink-escape write (exists() follows symlinks → arbitrary write): now symlink_metadata + reject symlink destinations.
  2. SSRF via ureq redirects (302 → 169.254.169.254): redirects disabled (max_redirects(0)), non-2xx rejected.
  3. Unbounded body read → OOM: 10 MiB cap via take().
  4. GitHub branch/tag URLs fell through to fetch the HTML UI: now rejected unless a 40-char commit SHA is pinned.
  5. Silent clobber of local edits on re-adopt: local file digest is now checked against the sidecar subject digest.
    Regression tests added for 1, 4, 5 (2 and 3 need a live server; covered by review).

@N4M3Z N4M3Z merged commit b2e86d9 into main Jul 9, 2026
4 checks passed
@N4M3Z N4M3Z deleted the p4-pkg branch July 9, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant